
const config = {
    firstStartGame: true,
    openPopup: false,
    gameType: "QQ",
    sclY:1,
    zs_sdk: null,
    vivoBanner: "c1a07b8da23448e29f194de93cfb4262",
    vivoRewardedVideoAd: "e18d1b7b36744078946f7b6ded25dd89",
    vivoCustomAd: "943a091dde4d4fbab44e0269594bea28",
    vivoCustomAd2: "7861c3496ab247b9bf8122e64d5f20c1",

    vivo_zs_version: 2.0,
    qg_createNativeAd: null,
    qg_loadCfg: null,

    showBanner: false,
    qq_loadCfg: null,
    qq_videoAd: "9d9a36c62e9683b842f22873454e742e",
    qq_bannerAd: "81dc60cdcf2a697084bd40c451198e04",
    addSpeed: 1,
    qq_onTrial: false,
    qq_stopTime: false,
    qq_gameOver: false,

    /**
     * 当前关卡是否结束
     */
    gameOver: false,
    /**
     * 引导
     */
    get guide() {
        if (!this._guide) {
            this._guide = JSON.parse(localStorage.getItem("guide") || "true");
        }
        return this._guide;
    },
    set guide(value: boolean) {
        this._guide = value;
        localStorage.setItem("guide", JSON.stringify(value));
    },
    get guideFood() {
        if (!this._guideFood) {
            this._guideFood = JSON.parse(localStorage.getItem("guideFood") || "false");
        }
        return this._guideFood;
    },
    set guideFood(value: boolean) {
        this._guideFood = value;
        localStorage.setItem("guideFood", JSON.stringify(value));
    },
    /**
     * 暂停
     */
    suspend: false,
    cutTime: 1,
    /**
     * 音效开关
     */
    get clickOffOrOn() {
        if (!this._clickOffOrOn) {
            this._clickOffOrOn = JSON.parse(localStorage.getItem("clickOffOrOn") || "true");
        }
        return this._clickOffOrOn;
    },
    set clickOffOrOn(value: boolean) {
        this._clickOffOrOn = value;
        localStorage.setItem("clickOffOrOn", JSON.stringify(value));
    },
    /**
     * 点击音效音量
     */
    get clickSound() {
        if (!this._clickSound) {
            this._clickSound = JSON.parse(localStorage.getItem("clickSound") || "0.5");
        }
        return this._clickSound;
    },
    set clickSound(value: number) {
        this._clickSound = value;
        localStorage.setItem("clickSound", JSON.stringify(value));
    },
    /**
     * 背景音量
     */
    get bgSound() {
        if (!this._bgSound) {
            this._bgSound = JSON.parse(localStorage.getItem("bgSound") || "0.5");
        }
        return this._bgSound;
    },
    set bgSound(value: number) {
        this._bgSound = value;
        localStorage.setItem("bgSound", JSON.stringify(value));
    },
    /**
     * 金币
     */
    get money() {
        if (!this._money) {
            this._money = JSON.parse(localStorage.getItem("money") || "300");
        }
        return this._money;
    },
    set money(value: number) {
        this._money = value;
        localStorage.setItem("money", JSON.stringify(value));
    },
    /**
     * 当前关卡
     */
    get checkPoint() {
        if (!this._checkPoint) {
            this._checkPoint = JSON.parse(localStorage.getItem("checkPoint") || "1");
        }
        return this._checkPoint;
    },
    set checkPoint(value: number) {
        this._checkPoint = value;
        localStorage.setItem("checkPoint", JSON.stringify(value));
    },
    /**
     * 配置表
     */
    dataJson: {
        checkPoint: null,
        batching: null,
        vegetableType: null,
        dialogue: null,
        guide: null
    },
    /**
     * 图集路径
     */
    spriteAtlasPath: {
        food: "plist/food",
    },
    /**
     * 图集集合
     */
    spriteAtlas: {} = cc.js.createMap(),
    /**
     * 预制体集合
     */
    prefabArr: {} = cc.js.createMap(),
    /**
     * 加载预制体的路径
     */
    prefabPath: {
        setPopup: "prefab/sound/sound",
        over: "prefab/over/over",
        levelUp: "prefab/level/levelUp",
        waiter: "prefab/waiter/waiter",
        suspend: "prefab/suspend/suspend",
        rank: "prefab/rank/rank",
        guide: "prefab/guide/guide",
        vivo: "prefab/vivo/vivo",
        timeNode: "prefab/vivo/timeNode",
    },
    /**
     * 对象池用到的预制体
     */
    nodeToolPath: {
        material: "prefab/material/material",
        orderItem: "prefab/order/orderItem",
        ready: "prefab/readyAndComplete/ready",
        complete: "prefab/readyAndComplete/complete",
        left: "prefab/delivery/left",
        right: "prefab/delivery/right",
    },
    /**
     * 音效集合
     */
    audioClipArr: {} = cc.js.createMap(),
    /**
    * 加载音效的路径
    */
    soundPath: {
        click: "music/click",
        bg: "music/bg",
        victory: "music/victory",
        fail: "music/fail"
    },
    /**
     * 材料初始化坐标
     */
    startPosition: cc.v2(0, 0),
    /**
     * 材料转折点坐标
     */
    transitionPosition: cc.v2(0, 0),
    /**
     * 材料回收坐标
     */
    endPosition: cc.v2(0, 0),
    /**
     * 当前正在做的订单
     */
    get selectOrder() {
        if (!this._order) {
            this._order = {}
        }
        return this._order;
    },
    set selectOrder(value: OrderInfo) {
        this._order = value;
    },
    /**
     * 当前全部订单
     */
    orderArr: [],
    orderCutUpTimeArr: [],
    /**
     * 切菜和烹饪的基础进度增长值 
     * 例：切菜总时长6秒，每次增长为 basicsTime / 6；
     */
    basicsTime: 0.0133,
    /**
     * 厨师1的初始属性
     */
    cook1: {
        type: 1,
        grade: 0,
        additionMoney: 0,
        additionTime: 0,
    },
    /**
     * 厨师1
     */
    get cook_1() {
        if (!this._cook_1) {
            this._cook_1 = localStorage.getItem('cook_1');
            if (this._cook_1) {
                this._cook_1 = JSON.parse(this._cook_1);
            } else {
                this._cook_1 = this.cook1;
            }
        }
        return this._cook_1;
    },
    set cook_1(value: cook) {
        this._cook_1 = value;
        localStorage.setItem("cook_1", JSON.stringify(value));
    },
    /**
     * 厨师1的初始属性
     */
    cook2: {
        type: 2,
        grade: 0,
        additionMoney: 0,
        additionTime: 0,
    },
    /**
     * 厨师2
     */
    get cook_2() {
        if (!this._cook_2) {
            this._cook_2 = localStorage.getItem('cook_2');
            if (this._cook_2) {
                this._cook_2 = JSON.parse(this._cook_2);
            } else {
                this._cook_2 = this.cook2;
            }
        }
        return this._cook_2;
    },
    set cook_2(value: cook) {
        localStorage.setItem("cook_2", JSON.stringify(value));
    },
}
export default config;